package cn.y.operation.application.web.controller;

import cn.y.operation.application.core.entity.SysUser;
import cn.y.operation.application.web.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 用户信息表(SysUser)表控制层
 *
 * @author Y
 * @since 2021-04-19 18:51:24
 */
@RestController
@RequestMapping("sysUser")
@Api(tags = "用户管理相关接口")
public class SysUserController {
    /**
     * 服务对象
     */
    @Resource
    private SysUserService sysUserService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @ApiOperation("根据id查询用户的接口")
    @GetMapping("selectOne")
    @ApiImplicitParam(name = "id", value = "用户id", defaultValue = "99", required = true)
    public SysUser selectOne(Long id) {
        return this.sysUserService.getById(id);
    }

}
